#define _CRT_SECURE_NO_WARNINGS 1

#include"SList.h"

void Test1()
{
	SLNode* plist = NULL;
	SLPushBack(&plist, 1);
	SLPushBack(&plist, 2);
	SLPushBack(&plist, 3);
	SLPushBack(&plist, 4);
	SLPushBack(&plist, 5);
	SLPrint(plist);
} 

void Test2()
{
	SLNode* plist = NULL;
	SLPushFront(&plist, 1);
	SLPushFront(&plist, 2);
	SLPushFront(&plist, 3);
	SLPushFront(&plist, 4);
	SLPushFront(&plist, 5);
	SLPrint(plist);
}

void Test3()
{
	SLNode* plist = NULL;
	SLPushBack(&plist, 1);
	SLPushBack(&plist, 2);
	SLPushBack(&plist, 3);
	SLPushBack(&plist, 4);
	SLPushBack(&plist, 5);
	SLPrint(plist);

	SLPopBack(&plist);
	SLPrint(plist);
	SLPopBack(&plist);
	SLPrint(plist);
	SLPopBack(&plist);
	SLPrint(plist);
}

void Test4()
{
	SLNode* plist = NULL;
	SLPushBack(&plist, 1);
	SLPushBack(&plist, 2);
	SLPushBack(&plist, 3);
	SLPushBack(&plist, 4);
	SLPushBack(&plist, 5);
	SLPrint(plist);

	SLPopFront(&plist);
	SLPrint(plist);
	SLPopFront(&plist);
	SLPrint(plist);
	SLPopFront(&plist);
	SLPrint(plist);
}

void Test5()
{
	SLNode* plist = NULL;
	SLPushFront(&plist, 1);
	SLPushFront(&plist, 2);
	SLPushFront(&plist, 3);
	SLPushFront(&plist, 4);
	SLPushFront(&plist, 5);
	SLPrint(plist);

	int x = 0;
	scanf("%d", &x);
	SLNode* pos = SLFind(plist, x);

	SLInsert(&plist, pos, x * 10);
	SLPrint(plist);

}

void Test6()
{
	SLNode* plist = NULL;
	SLPushFront(&plist, 1);
	SLPushFront(&plist, 2);
	SLPushFront(&plist, 3);
	SLPushFront(&plist, 4);
	SLPushFront(&plist, 5);
	SLPrint(plist);

	int x = 0;
	scanf("%d", &x);
	SLNode* pos = SLFind(plist, x);

	SLInsertAfter(pos, x * 10);
	SLPrint(plist);

}

void Test7()
{
	SLNode* plist = NULL;
	SLPushFront(&plist, 1);
	SLPushFront(&plist, 2);
	SLPushFront(&plist, 3);
	SLPushFront(&plist, 4);
	SLPushFront(&plist, 5);
	SLPrint(plist);

	int x = 0;
	scanf("%d", &x);
	SLNode* pos = SLFind(plist, x);

	SLErase(&plist, pos);
	
	SLPrint(plist);

}

void Test8()
{
	SLNode* plist = NULL;
	SLPushFront(&plist, 1);
	SLPushFront(&plist, 2);
	SLPushFront(&plist, 3);
	SLPushFront(&plist, 4);
	SLPushFront(&plist, 5);
	SLPrint(plist);

	int x = 0;
	scanf("%d", &x);
	SLNode* pos = SLFind(plist, x);

	SLEraseAfter(pos);
	pos = NULL;
	SLPrint(plist);
}

int main()
{
	//Test1();
	//Test2();
	//Test3();
	//Test4();
	//Test5();
	//Test6();
	//Test7();
	Test8();
	return 0;
}